package org.yellow.backend.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
import org.yellow.backend.pojo.Appointment;
import org.yellow.backend.pojo.patient;
import org.yellow.backend.pojo.queue;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Repository
public interface queueMapper extends BaseMapper<queue> {
    @Select("SELECT patients.patient_id,patients.name,patients.gender,patients.contact_number" +
            ",patients.Status from queue join patients on queue.patient_id=patients.patient_id")
    List<patient> showQueueInter();

    @Select("SELECT * FROM appointments WHERE doctor_id = #{doctorId} AND status = 'Confirmed'")
    List<Appointment> showActiveQueue(int doctorId);
}
